﻿package baseEngine.core
{
    import __AS3__.vec.*;
    import flash.display3D.*;
    import flash.events.*;
    import flash.utils.*;

    public class Surface3D extends EventDispatcher
    {
        public var bounds:Boundings3D;
        public var firstIndex:int = 0;
        public var sizePerVertex:int = 0;
        public var bufferVoMap:Dictionary;
        public var name:String;
        protected var _needUpdate:Boolean = true;
        public var impUpload:Boolean = false;
        public var loadedTime:uint;
        private var _polys:Vector.<Poly3D>;
        public var visible:Boolean = true;

        public function Surface3D(param1:String)
        {
            this.bufferVoMap = new Dictionary(false);
            this.name = param1;
            this.loadedTime = uint.MAX_VALUE;
            this.clear();
            return;
        }// end function

        final public function get needUpdate() : Boolean
        {
            return this._needUpdate;
        }// end function

        public function clear() : void
        {
            this.bounds = null;
            return;
        }// end function

        public function disposeImp() : void
        {
            this.download();
            this.bounds = null;
            return;
        }// end function

        public function download() : void
        {
            return;
        }// end function

        public function toUpdate() : void
        {
            this._needUpdate = true;
            return;
        }// end function

        public function contextEvent(param1:Context3D) : Boolean
        {
            if (!this._needUpdate)
            {
                return true;
            }
            throw new Error("请覆盖contextEvent方法，from Surface3D.as");
        }// end function

        override public function toString() : String
        {
            return "[object Surface3D name:" + this.name + "]";
        }// end function

        public function clone() : Surface3D
        {
            var _loc_1:* = new Surface3D(this.name);
            _loc_1.firstIndex = this.firstIndex;
            return _loc_1;
        }// end function

        public function updateBoundings() : Boundings3D
        {
            return null;
        }// end function

        public function get polys() : Vector.<Poly3D>
        {
            return this._polys;
        }// end function

        public function set polys(param1:Vector.<Poly3D>) : void
        {
            this._polys = param1;
            return;
        }// end function

    }
}
